<template>
  <div class="myselfReCord">
    <navBar :name="title" />
    <myselfReCordTop :content="contents" />
    <recordList :list="list" />
  </div>
</template>

<script>
import recordList from "./components/recordList.vue";
import myselfReCordTop from "./components/myselfReCordTop.vue";
import navBar from "@/components/commonComponents/navBar.vue";
export default {
  name: "myselfReCord",
  components: { navBar, myselfReCordTop, recordList },
  data() {
    return {
      title: "服药记录",
      contents: {},
      list: [
        {
          id: 1,
          date: "2022年1月9日21点58分",
          medicine: "阿司匹林",
          record: "是",
        },
        {
          id: 2,
          date: "2022年1月9日21点58分",
          medicine: "阿司匹林",
          record: "是",
        },
        {
          id: 3,
          date: "2022年1月9日21点58分",
          medicine: "阿司匹林",
          record: "是",
        },
        {
          id: 4,
          date: "2022年1月9日21点58分",
          medicine: "阿司匹林",
          record: "是",
        },
        {
          id: 5,
          date: "2022年1月9日21点58分",
          medicine: "阿司匹林",
          record: "是",
        },
      ],
    };
  },
  created() {
    let user_type = this.$store.state.user_type;
    if (user_type == 2) {
      this.contents = { date: "日期", medicine: "药名", record: "是否已服用" };
      this.title = "服药记录";
    }
  },
};
</script>

<style lang="scss" scope>
.myselfReCord {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 40px;
  overflow-y: scroll;
  background-color: #fafafa;
}
</style>
